﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.master" AutoEventWireup="true"
    CodeFile="GioHang.aspx.cs" Inherits="Pages_GioHang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <script type="text/javascript">
        // From: http://www.webdeveloper.com/forum/showthread.php?t=218226

        function ToggleList(IDS, dis) {
            var CState = document.getElementById(IDS);
            CState.style.display = dis;
        }
        function ShowExt(object) {
            if (object == 'DV') {
                ToggleList('A', 'block');
            }
            else
                ToggleList('A', 'none');
        }
    </script>
    <div style="background: #FFFFFF; width: 98%; margin: auto;">
        <div style="text-align: right;">
            <img src="../Images/DanhSachSanPham.jpg" />
            <img src="../Images/DanhSachSanPham1.jpg" />
            <br />
            <asp:Label runat="server" ID="Loi" ForeColor="Red"></asp:Label>
            <div>
                <asp:GridView ID="Ds_giohang" runat="server" AutoGenerateColumns="False" Width="100%"
                    OnRowCancelingEdit="Ds_giohang_RowCancelingEdit" OnRowDataBound="Ds_giohang_RowDataBound"
                    OnRowDeleting="Ds_giohang_RowDeleting" OnRowEditing="Ds_giohang_RowEditing" OnRowUpdating="Ds_giohang_RowUpdating"
                    ShowFooter="True" BackColor="White" BorderColor="#999999" BorderStyle="None"
                    BorderWidth="1px" CellPadding="3" GridLines="Vertical">
                    <AlternatingRowStyle BackColor="#DCDCDC" />
                    <Columns>
                        <asp:TemplateField HeaderText="STT" HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text="<%# Tinh_STT() %>"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <%--  <asp:ImageField DataImageUrlField="Hinh" DataImageUrlFormatString="~/Photos/SanPham/{0}"
                                    ReadOnly="True" HeaderStyle-HorizontalAlign="Center">
                                    <ControlStyle Width="100px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:ImageField>--%>
                        <asp:BoundField HeaderText="Sản phẩm" DataField="TenSanpham" ReadOnly="True" HeaderStyle-HorizontalAlign="Center">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="SoLuong" HeaderText="Số lượng" HeaderStyle-HorizontalAlign="Center" />
                        <asp:BoundField HeaderText="Đơn giá" DataField="DonGia" FooterText="Tổng cộng" ReadOnly="True"
                            DataFormatString="{0:#, ##0}" HeaderStyle-HorizontalAlign="Center">
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ThanhTien" HeaderText="Thành tiền" ReadOnly="True" DataFormatString="{0:#, ##0}"
                            HeaderStyle-HorizontalAlign="Center">
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:CommandField ButtonType="Button" DeleteText="Xoá" EditText="Cập nhật số lượng"
                            ShowDeleteButton="True" ShowEditButton="True" CancelText="Bỏ qua" UpdateText="Ghi nhận thay đổi">
                            <ItemStyle HorizontalAlign="Center" Width="190" />
                        </asp:CommandField>
                    </Columns>
                    <EmptyDataTemplate>
                        <p style="color: Red; text-align: center; font-weight: bold;">
                            Bạn chưa chọn món ăn nào</p>
                    </EmptyDataTemplate>
                    <FooterStyle BackColor="#003399" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#0000A9" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#000065" />
                </asp:GridView>
            </div>
        </div>
        <div style="border-bottom: 1px solid  #d2d2d2; height: 30px;">
            <h3>
                Lựa chọn phương thức vận chuyển</h3>
        </div>
        <div>
            <asp:RadioButtonList ID="rdbHinhThucVanChuyen" runat="server">
            </asp:RadioButtonList>
        </div>
        <div id="A" style="display: none;">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table border="0" width="700" style="padding-left: 30px;">
                        <tr>
                            <td colspan="4" style="font-size: 11.5px; font-style: italic; font-weight: bold;">
                                Giá và thông tin khác cung cấp bởi đơn vị vận chuyển
                                <br />
                                Quý khách vui lòng cung cấp thông tin chính xác nơi giao hàng
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 70px;">
                                Quốc gia:
                            </td>
                            <td style="width: 160px;">
                                <asp:DropDownList AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlQuocGiaSelectedIndexChange"
                                    ID="ddlQuocGia" Width="150" Height="30" DataTextField="TenNuoc" DataValueField="Id">
                                </asp:DropDownList>
                            </td>
                            <td style="width: 90px;">
                                Thành phố:
                            </td>
                            <td align="left">
                                <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="ddlThanhPhoSelectedIndexChange" runat="server" ID="ddlThanhPho" Width="150" Height="30" DataTextField="TenThanhPho"
                                    DataValueField="Id">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Địa chỉ:
                            </td>
                            <td colspan="3">
                                <asp:TextBox runat="server" ID="txtDiaChi" Height="25" Width="400"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                Giá vận chuyển: <asp:Label runat="server" ID="lbGiaVC"></asp:Label> USD
                            </td>
                        </tr>
                    </table>
                    
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div style="border-bottom: 1px solid  #d2d2d2; height: 30px;">
            <h3>
                Lựa chọn phương thức thanh toán</h3>
        </div>
        <table>
            <tr>
                <td>
                    <script type="text/javascript" language="javascript">
                                
                    </script>
                    <asp:LinkButton ID="lbtTT" OnClick="lbtTT_Click" Text="Quý khách tự đến cửa hàng thanh toán"
                        runat="server"></asp:LinkButton>
                </td>
                <td>
                    <asp:ImageButton ID="CheckoutImageBtn" runat="server" ImageUrl="https://paypal.com/en_US/i/btn/btn_xpressCheckout.gif"
                        Width="145" AlternateText="Check out with Paypal" OnClick="CheckoutBtn_Click"
                        BackColor="Transparent" BorderWidth="0" />
                </td>
            </tr>
        </table>
        <div>
        </div>
    </div>
</asp:Content>
